<?php

namespace addons\kuerp\validate;

use think\Validate;
//l联系人
class Contacts extends Validate {
	/**
	 * 验证规则
	 */
	protected $rule = [
		'name'           => 'max:50',
		'mobile'         => 'max:32',
		'subname'        => 'max:50',
		'sex'            => 'number|between:0,2',
		'role'           => 'max:32',
		'post'           => 'max:32',
		'birthday'       => 'max:32',
		'email'          => 'email|max:32',
		'telephone'      => 'max:32',
		'wechat'         => 'max:32',
		'qq'             => 'max:32',
		'address'        => 'max:64',
		'address_detail' => 'max:64',
		'remarks'        => 'max:250',

	];
	/**
	 * 提示消息
	 */
	protected $message = [];
	/**
	 * 字段描述
	 */
	protected $field = [
		'create_staff_id' => '员工',
		'owner_staff_id'  => '员工',
		'customer_id'     => '所属客户',
		'name'            => '联系人名称',
		'subname'         => '助记名称',
		'mobile'          => '手机号',
		'sex'             => '性别',
		'role'            => '角色',
		'post'            => '职务',
		'birthday'        => '生日',
		'email'           => '邮箱',
		'telephone'       => '座机',
		'wechat'          => '微信号',
		'qq'              => 'qq',
		'address'         => '所在地区',
		'address_detail'  => '详细地址',
		'remarks'         => '备注信息',


	];
	/**
	 * 验证场景
	 */
	protected $scene = [
		'create' => [
			'name',
			'subname',
			'mobile',
			'sex',
			'role',
			'post',
			'birthday',
			'email',
			'telephone',
			'wechat',
			'qq',
			'address',
			'address_detail',
			'remarks'
		],
		'edit'   => [
			'name',
//			'subname',
			'mobile',
			'sex',
			'role',
			'post',
			'birthday',
			'email',
			'telephone',
			'wechat',
			'qq',
			'address',
			'address_detail',
			'remarks'
		],
	];
}
